package com.itheima;

import com.example.HeaderParser;
import com.example.TokenParser;
import com.google.gson.Gson;
import com.itheima.pojo.Result;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

@SpringBootTest
public class Demo {
    @Autowired
    private Gson gson;
    @Autowired
    private ApplicationContext applicationContext;
    @Test
    public void gson(){
        String json = gson.toJson(Result.error("1"));
        System.out.println(json);
    }
    @Test
    public void TokenParser(){
        HeaderParser bean = applicationContext.getBean(HeaderParser.class);
        System.out.println(bean);
    }
}
